import request from '@/utils/request'
const baseUrl = process.env.VUE_APP_TMS_BOOTSTRAP_HOST
// 文件上传
// export function fileUpload(data) {
//   return request({
//     url: `${baseUrl}/api/v1/common-file/upload`,
//     method: 'post',
//     data
//   })

export function fileUpload(formData) {
  return request({
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    url: `${baseUrl}/api/v1/common-file/upload`,
    method: 'post',
    data: formData
  })
}
// 文件下载
export function fileDownload(dir) {
  return request({
    url: `${baseUrl}/api/v1/common/file/upload`,
    method: 'get',
    params: dir
  })
}// 文件删除
export function fileDestroy(data) {
  return request({
    headers: {
      'Content-Type': 'application/json'
    },
    url: `${baseUrl}/api/v1/common-file/batchDelete`,
    method: 'post',
    data
  })
}
// Url补全
export function supplyUrl(url) {
  return `${baseUrl}/api/v1/common-file/download/${url}`
}
